package com.swgk.core.recyclerview.entity;

import com.contrarywind.interfaces.IPickerViewData;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

public class BaseAreaEntity<T> implements IPickerViewData, Serializable {
    @SerializedName("id")
    private String id;
    @SerializedName("name")
    private String name;
    @SerializedName("no")
    private String no;
    @SerializedName(value = "children", alternate = {"childrenList"})
    private T children;
    @SerializedName("parentNo")
    private String parentNo;
    @SerializedName("simpleName")
    private String simpleName;
    Integer index;
    private Boolean isSelected;
    @SerializedName(value = "cityIds")
    private T cityIds;
    @SerializedName("parentId")
    private String parentId;

    private String parentName;

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public int getIndex() {
        return index == null ? 0 : index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getSimpleName() {
        return simpleName;
    }

    public void setSimpleName(String simpleName) {
        this.simpleName = simpleName;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public T getChildren() {
        return children;
    }

    public void setChildren(T children) {
        this.children = children;
    }

    public String getParentNo() {
        return parentNo;
    }

    public void setParentNo(String parentNo) {
        this.parentNo = parentNo;
    }

    @Override
    public String getPickerViewText() {
        return name;
    }

    public boolean isSelected() {
        return isSelected == null ? false : isSelected;
    }

    public void setSelected(boolean selected) {
        isSelected = selected;
    }

    public T getCityIds() {
        return cityIds;
    }

    public void setCityIds(T cityIds) {
        this.cityIds = cityIds;
    }

    public String getParentId() {
        return parentId;
    }

    public void setParentId(String parentId) {
        this.parentId = parentId;
    }
}
